import clientRequest from "@/utils/client-request.ts";

export function submitCodeApi(problemId: string, language: number, code: string) {
    return clientRequest({
        url: '/submit',
        method: 'POST',
        data: {
            problemId: problemId,
            language: language,
            code: code
        }
    })
}

export function  getCodeSubmitDetailApi(codeSubmitId: string) {
    return clientRequest({
        url: '/submit/' + codeSubmitId,
        method: 'GET'
    })
}

export function listCodeSubmitsApi(problemId: string) {
    return clientRequest({
        url: '/submit',
        method: 'GET',
        params: {
            problemId: problemId
        }
    })
}